Explictly call usb_set_configuration() on Mac, as we did < 1.3.6, to improve
authorrobertl <robertl>
Sun, 5 Apr 2009 22:58:07 +0000 (22:58 +0000)
committerrobertl <robertl>
Sun, 5 Apr 2009 22:58:07 +0000 (22:58 +0000)
reliability of USB xfers on select Garmins.

jeeps/gpslibusb.c

index 34872d6951dc002180bb19d836011d06d5cf7c7f..99a13bb0b846235cce9780ad87bf4b1e7c14a57e 100644 (file)
@@ -269,6 +269,16 @@ garmin_usb_start(struct usb_device *dev, libusb_unit_data *lud)
        /*
         * Hrmph.  No iManufacturer or iProduct headers....
         */
+
+       
+#if __APPLE__
+       // On Leopard, if we don't do an explicit set_configuration, some
+       // devices will work only the first time after a reset.
+       if (usb_set_configuration(udev, 1) < 0) {
+               fatal("usb_set_configuration failed: %s\n", usb_strerror());
+       };
+#endif
+
 #if 0
        if (usb_set_configuration(udev, 1) < 0) {
 #if __linux__